package com.pattern.adapter.objectadapter;

/**
 * @author 冯志立
 * @create 2019-10-25 11:44
 */
public class VoltageAdapter implements Voltage5V {
    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int dstV = 0;
        if (null != voltage220V) {

            int i = voltage220V.output220V();
            dstV = i / 44; //转成5v
        }
        return dstV;
    }
}
